Repository navigation
parser: support new syntax for extended statistics - #913
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #913 +/- ##
==========================================
+ Coverage 78.37% 78.48% +0.10%
==========================================
Files 40 40
Lines 14936 14984 +48
==========================================
+ Hits 11706 11760 +54
+ Misses 2538 2527 -11
- Partials 692 697 +5 |
Contributor
|
Current syntax: CREATE STATISTICS [IF NOT EXISTS] statistics_name
[ '(' CARDINALITY ')' | '(' DEPENDENCY ')' | '(' CORRELATION ')' ]
ON table_name '(' column_name ',' column_name [',' ...] ')'For comparison, PostgreSQL (and CockroachDB): CREATE STATISTICS [IF NOT EXISTS] statistics_name
[ '(' { NDISTINCT | DEPENDENCIES | MCV } [',' ...] ')' ]
ON column_name ',' column_name [',' ...]
FROM table_nameCREATE STATISTICS statistics_name
ON table_name '(' column_name ',' column_name [',' ...] ')'
[ WHERE predicate ]
[ WITH options ]CREATE STATISTICS statistics_name
ON table_name [ '(' column_name ',' column_name [',' ...] ')' ] FOR { DEFAULT | EXTENDED } STORAGE
[ TYPE statistics_type ]
[ statistics_properties ',' statistics_properties [',' ...] ]
[ [ NO ] INITIAL REFRESH ]So the current syntax looks like a strange mix of PostgreSQL and Transact-SQL. Question:
|
Contributor
Author
|
@kennytm the idea of extended statistics is mainly borrowed from PostgreSQL, but we plan to support different types of statistics, i.e, correlation. The definition of table and columns, i.e, |
eurekaka
force-pushed
the
ext_stats
branch
2 times, most recently
from
July 27, 2020 11:21
f1e9207 to
9d24cf0
Compare
Contributor
Author
|
CI failure should be fixed after pingcap/tidb#18787 is merged. |
qw4990
reviewed
Jul 29, 2020
Contributor
Contributor
This was referenced Aug 11, 2020
vitthalaa
pushed a commit
to vitthalaa/parser
that referenced
this pull request
Oct 14, 2020
tiancaiamao
pushed a commit
to tiancaiamao/parser
that referenced
this pull request
Apr 27, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Parser changes of pingcap/tidb#18330
What is changed and how it works?
Add new SQL syntax
CREATE STATISTICS/DROP STATISTICS/ADMIN RELOAD STATISTICSsupport.Check List
Tests
Code changes
Side effects
N/A
Related changes